package test.study.concurrent.thread._3_future.future_task;

import cn.hutool.core.thread.ThreadUtil;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.FutureTask;

@Slf4j
public class _2_FutureTask_Main {

    @SneakyThrows
    public static void main(String[] args) {
        //
        FutureTask task = new FutureTask(() -> {
            log.info("执行 runnable");
            ThreadUtil.sleep(3 * 1000);
        }, "hahdsafds");

        //
        new Thread(task)
                .start();

        //
//        Object result = task.get();
//        log.info("{}", result);
    }
}
